<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap CSS -->
    <link crossorigin="anonymous"
          integrity="sha512-6KY5s6UI5J7SVYuZB4S/CZMyPylqyyNZco376NM2Z8Sb8OxEdp02e1jkKk/wZxIEmjQ6DRCEBhni+gpr9c4tvA==" href="https://lib.baomitu.com/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>

<head th:replace="layouts::header"></head>

<div class="container">
    <form action="/students/save" th:field="${student}" method="POST">
<!--        用于更新学生信息时获得被点击的学生的id-->
        <input type="hidden" th:field="${student.studentId}">
<br>
        <div class="form-group">
             <div class="col-sm-6">
        <input type="text" placeholder="姓名" th:field="${student.name}">
                 <span th:if="${#fields.hasErrors('name')}" th:errors="${student.name}"></span>
             </div>
        </div><br>
        <div class="form-group">
            <div class="col-sm-6">
        <input type="text" placecholder="微信号" th:field="${student.wechatId}">
            <span th:if="${#fields.hasErrors('wechatId')}" th:errors="${student.wechatId}"></span>
            </div>
        </div><br>
        <div class="form-group">
            <div class="col-sm-6">
        <input type="text" placeholder="邮箱" th:field="${student.email}">
         <span th:if="${#fields.hasErrors('email')}" th:errors="${student.wechatId}"></span>
            </div>
        </div><br>
        <input type="hidden" name="_csrf" th:value="${_csrf.token}">

        <button class="btn btn-info" type="submit">新建学生</button>
    </form>
</div>
</body>
</html>